/***************************************************************************
 *   Copyright (C) 2007 by Jiří Němec   *
 *   nemec.jiri@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef HLEDANI_H
#define HLEDANI_H

#include <QThread>
#include <QFile>
#include "radek.h"
#include "hashtable.h"



class Hledani : public QThread {
    Q_OBJECT
public:
    void run();
    void setText(const QString &text);
    void setPriority(const QString &text);
    void indexHledani();
    void fulltextHledani();
    volatile bool stop;
    Hledani(HashTabulka *, QString);
    Radek najdiPodlePozice(qint64);
    ~Hledani();
private:
    HashTabulka * slovnik;

    QString text;
    QString localFileName;
    QString priority;
    QFile dataFile;
public slots:
    void setStop();
    void startHledani(const QString &text);

signals:
    void vysledekHledani(const QVector<Radek> &);
    void zmenaStatusu(const QString &text);

};

#endif
